#pragma once
#ifndef NODEENSEMBLE_H
#define NODEENSEMBLE_H

#include<QGraphicsScene>
#include<QVector>
#include<QWidget>

#include"types.h"
#include"node_item.h"
#include"node_socket.h"


class NodeEnsemble : public QWidget
{
public:
    NodeEnsemble(const int index,QWidget *parent=nullptr);
    NodeEnsemble(const int index,const int type,QWidget *parent=nullptr);
    NodeEnsemble(const NodeEnsemble &node_ensemble,QWidget *parent=nullptr);// copy construction
    // move construction
    void operator=(const NodeEnsemble &node_ensemble);// operator
    ~NodeEnsemble();

    void initSocket(int number_left,int number_right);
    void setIndex(int n){this->index = n; }
    void setItemTitle(QString title);
    int getSelectedSocketIndex();
    void debugOutput();



public:
    std::shared_ptr<NodeItemBase> item;
    QVector<std::shared_ptr<NodeSocket>> input;
    QVector<std::shared_ptr<NodeSocket>> output;


    QString node_name;
    int index;
    int input_number;
    int output_number;
    int input_valid=0;
    int output_valid=0;
};

#endif // NODEENSEMBLE_H
